package com.nercel.dsj.gksales.service;

import com.nercel.dsj.gksales.model.QueryParams;
import com.nercel.dsj.gksales.model.dto.RoleParamsDTO;
import com.nercel.dsj.gksales.model.entity.Role;

import java.util.List;

/**
 * @author sunlin
 * @date 2018-11-16
 */
public interface RoleService extends DaoBaseService<Role, Integer>  {

    List<Role> list(QueryParams queryParams);

    Role findByRoleName(String name);

    void save(RoleParamsDTO role);

    void update(RoleParamsDTO role);

    int addPermissions(Integer roleId, List<Integer> ids);

    void deletePermission(Integer roleId, Integer permissionId);

    void updatePermissions(Integer roleId, List<Integer> ids);

    List<Role> selectByUserIdWithPermissions(Integer id);

}
